<?php
  session_start();
  if ($_SESSION["loggedin"] != true) {
    $_SESSION["loggedin"] = false;
    header("Location: http://" . $HTTP_SERVER_VARS['HTTP_HOST'] . dirname($HTTP_SERVER_VARS['PHP_SELF']) . "/index.php");
    exit;
  }
?>